<template>
  <div>
    <div style="margin-top:20px" class="qup-title-box"><span class="border" /><span>基础信息</span></div>
    <el-form
      ref="refForm1"
      :rules="formRules"
      :model="formData"
      size="mini"
      label-width="150px"
    >

      <el-row>
        <el-col :span="8">
          <el-form-item label="配图任务编号:" prop="taskCode">
            <el-input v-model="formData.taskCode" disabled />
          </el-form-item>
        </el-col>
        <el-col :span="8">
          <el-form-item label="任务来源编号:" prop="sourceCode">
            <el-input v-model="formData.sourceCode" disabled />
          </el-form-item>
        </el-col>
        <el-col :span="8">
          <el-form-item label="配图进度:" prop="drawingSchedule">
            <el-select
              v-model="formData.drawingSchedule"
              style="width: 100%"
              disabled
            >
              <el-option
                v-for="item in drawingScheduleList"
                :key="item.dictCode"
                :label="item.dictName"
                :value="item.dictCode"
              />
            </el-select>
          </el-form-item>
        </el-col>
      </el-row>
      <el-row>
        <!-- {
            prop: 'taskState',
            label: '任务状态',
            minWidth: '110',
            propEnum: {
              domainCode: 'marketing',
              appCode: 'slm',
              dictTypeCode: 'SLM_DRAWING_STATUS'
            }
          }, -->
        <el-col :span="8">
          <el-form-item label="配图状态:" prop="taskState">
            <el-select
              v-model="formData.taskState"
              style="width: 100%"
              disabled
            >
              <el-option
                v-for="item in taskStateList"
                :key="item.dictCode"
                :label="item.dictName"
                :value="item.dictCode"
              />
            </el-select>
          </el-form-item>
        </el-col>
        <el-col :span="8">
          <el-form-item label="门店建设项目号:" prop="constCode">
            <el-input v-model="formData.constCode" disabled />
          </el-form-item>
        </el-col>
        <el-col :span="8">
          <el-form-item label="门店建设状态:" prop="shopState">
            <el-select
              v-model="formData.shopState"
              style="width: 100%"
              disabled
            >
              <el-option
                v-for="item in shopStateList"
                :key="item.dictCode"
                :label="item.dictName"
                :value="item.dictCode"
              />
            </el-select>
          </el-form-item>
        </el-col>
      </el-row>
      <el-row>
        <el-col :span="8">
          <el-form-item label="装修进度:" prop="decorationSchedule">
            <el-select
              v-model="formData.decorationSchedule"
              style="width: 100%"
              disabled
            >
              <el-option
                v-for="item in decorationScheduleList"
                :key="item.dictCode"
                :label="item.dictName"
                :value="item.dictCode"
              />
            </el-select>
          </el-form-item>
        </el-col>
        <el-col :span="8">
          <el-form-item label="进场时间:" prop="enterTime">
            <el-input v-model="formData.enterTime" disabled />
          </el-form-item>
        </el-col>
      </el-row>
      <el-row>
        <el-col :span="8">
          <el-form-item label="门店编码:" prop="shopCode">
            <el-input v-model="formData.shopCode" disabled />
          </el-form-item>
        </el-col>
        <el-col :span="16">
          <el-form-item label="店面名称:" prop="shopName">
            <el-input v-model="formData.shopName" disabled />
          </el-form-item>
        </el-col>
      </el-row>
      <el-row>
        <el-col :span="8">
          <el-form-item label="店面等级:" prop="shopLevel">
            <el-select
              v-model="formData.shopLevel"
              style="width: 100%"
              disabled
            >
              <el-option
                v-for="item in shopLevelList"
                :key="item.dictCode"
                :label="item.dictName"
                :value="item.dictCode"
              />
            </el-select>
          </el-form-item>
        </el-col>
        <el-col :span="8">
          <el-form-item label="门店营业状态:" prop="businessStatus">
            <el-select
              v-model="formData.businessStatus"
              style="width: 100%"
              disabled
            >
              <el-option
                v-for="item in businessStatusList"
                :key="item.dictCode"
                :label="item.dictName"
                :value="item.dictCode"
              />
            </el-select>
          </el-form-item>
        </el-col>
      </el-row>
      <el-row>
        <el-col :span="8">
          <el-form-item label="SAP编码:" prop="sapCode">
            <el-input v-model="formData.sapCode" disabled />
          </el-form-item>
        </el-col>
        <el-col :span="16">
          <el-form-item label="SAP编码名称:" prop="sapName">
            <el-input v-model="formData.sapName" disabled />
          </el-form-item>
        </el-col>
      </el-row>
      <el-row>
        <el-col :span="8">
          <el-form-item label="SAP编码创建时间:" prop="sapCreateTime">
            <el-input v-model="formData.sapCreateTime" disabled />
          </el-form-item>
        </el-col>
        <el-col :span="8">
          <el-form-item label="有无橱柜权限:" prop="cabinetPermission">
            {{ formData.cabinetPermission===1||formData.cabinetPermission===0?(formData.cabinetPermission?'是':'否'):formData.cabinetPermission }}
          </el-form-item>
        </el-col>
        <el-col :span="8">
          <el-form-item label="有无衣柜权限:" prop="wardrobePermission">
            {{ formData.wardrobePermission===1||formData.wardrobePermission===0?(formData.wardrobePermission?'是':'否'):formData.cabinetPermission }}
          </el-form-item>
        </el-col>
      </el-row>
      <el-row>
        <el-col :span="8">
          <el-form-item label="定制客户经理:" prop="customerManagerName">
            <el-input v-model="formData.customerManagerName" disabled />
          </el-form-item>
        </el-col>
        <el-col :span="8">
          <el-form-item label="联系电话:" prop="customerManagerTel">
            <el-input v-model="formData.customerManagerTel" disabled />
          </el-form-item>
        </el-col>
        <el-col :span="8">
          <el-form-item label="确图时间:" prop="confirmPicTime">
            <el-input v-model="formData.confirmPicTime" disabled />
          </el-form-item>
        </el-col>
      </el-row>
    </el-form>
  </div>
</template>
<script>
import { getDictByPatchType } from '@/api/dataDict'

export default {
  name: 'BaseInfo',
  props: {
    baseInfo: {
      type: Object,
      default: () => {}
    }
  },
  data() {
    return {
      formData: {},
      drawingScheduleList: [],
      shopStateList: [],
      decorationScheduleList: [],
      shopLevelList: [],
      taskStateList: [],
      businessStatusList: [],
      formRules: {}
    }
  },
  watch: {
    baseInfo: {
      handler(v) {
        this.formData = v
      },
      deep: true,
      immediate: true
    }
  },
  async created() {
    const { SLM_DRAWING_PROGRESS, CONST_STATE, DECORATION_SCHEDULE, SHOP_LEVEL_CODE, SLM_DRAWING_STATUS, SHOP_BIZ_STATE } =
     await getDictByPatchType(['SLM_DRAWING_PROGRESS', 'CONST_STATE', 'DECORATION_SCHEDULE', 'SHOP_LEVEL_CODE', 'SLM_DRAWING_STATUS', 'SHOP_BIZ_STATE'])
    this.drawingScheduleList = SLM_DRAWING_PROGRESS
    this.shopStateList = CONST_STATE
    this.decorationScheduleList = DECORATION_SCHEDULE
    this.shopLevelList = SHOP_LEVEL_CODE
    this.taskStateList = SLM_DRAWING_STATUS
    this.businessStatusList = SHOP_BIZ_STATE
  }
}
</script>
